12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8c86bcce"],{"0387":function(t,e,n){"use strict";n.r(e),n.d(e,"meshFeatureSetFromJSON",(function(){return ne}));var r=n("8d60"),o=n("b2b2"),i=n("3af1"),a=n("a4ee"),c=n("ce50"),s=n("9096"),l=n("6d5f"),u=n("e92d"),f=n("fab3"),b=n("f4cc"),p=n("477c"),h=n("59b2"),g=(n("b50f"),n("c120"),n("cea0"),n("d386")),O=n("0b2d"),j=n("3760"),d=n("4ae5"),m=n("1219"),y=n("33b0"),x=n("f0ba"),v=n("64d5"),w=n("f5e7"),A=n("1666"),R=n("8188"),F=n("3ebc"),M=n("e9ba");const k=u["a"].getLogger("esri.geometry.support.meshUtils.centerAt");function E(t,e,n){var r;if(!t.vertexAttributes||!t.vertexAttributes.position)return;const i=null!=(r=null==n?void 0:n.origin)?r:t.origin;Object(o["k"])(t.transform)?(null!=(null==n?void 0:n.geographic)&&n.geographic!==t.transform.geographic&&k.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${t.transform.geographic}) is not supported`),z(t.transform,e,i)):Object(F["a"])(t.spatialReference,n)?P(t,e,i):L(t,e,i)}function z(t,e,n){const r=e.x-n.x,o=e.y-n.y,i=e.hasZ&&n.hasZ?e.z-n.z:0,a=t.origin;t.origin=[a[0]+r,a[1]+o,a[2]+i]}function P(t,e,n){const r=Object(M["d"])(t.vertexAttributes,n,{geographic:!0}),{position:o,normal:i,tangent:a}=Object(M["a"])(r,e,{geographic:!0});t.vertexAttributes.position=o,t.vertexAttributes.normal=i,t.vertexAttributes.tangent=a,t.vertexAttributesChanged()}function L(t,e,n){const r=N,o=I;if(Object(R["t"])(e,o,t.spatialReference)){if(!Object(R["t"])(n,r,t.spatialReference)){const e=t.origin;r[0]=e.x,r[1]=e.y,r[2]=e.z,k.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${t.spatialReference.wkid}).`)}T(t.vertexAttributes.position,o,r),t.vertexAttributesChanged()}else k.error(`Failed to project centerAt location (wkid:${e.spatialReference.wkid}) to mesh spatial reference (wkid:${t.spatialReference.wkid})`)}function T(t,e,n){if(t)for(let r=0;r<t.length;r+=3)for(let o=0;o<3;o++)t[r+o]+=e[o]-n[o]}const I=Object(O["f"])(),N=Object(O["f"])();var S=n("e041");async function C(t,e,r){const{loadGLTFMesh:i}=await Object(b["z"])(n.e("chunk-2d2290bf").then(n.bind(null,"dc7a")),r),a=await U(e,r),c=i(new d["a"]({x:0,y:0,z:0,spatialReference:t.spatialReference}),a.url,{resolveFile:D(a),useTransform:!0,signal:Object(o["k"])(r)?r.signal:null});c.then(()=>a.dispose(),()=>a.dispose());const{vertexAttributes:s,components:l}=await c;t.vertexAttributes=s,t.components=l}function D(t){const e=Object(S["I"])(t.url);return n=>{var r;const o=Object(S["E"])(n,e,e),i=o?o.replace(/^ *\.\//,""):null;return null!=(r=t.files.get(i))?r:n}}async function U(t,e){return t instanceof Blob?$.fromBlob(t):"string"==typeof t?new $(t):Array.isArray(t)?G(t,e):B(t,e)}async function G(t,e){const n=new Map;let r=null;const i=await Object(b["k"])(t.map(async t=>({name:t.name,source:await U(t instanceof Blob?t:t.source,e)}))),a=[];for(const o of i)o&&(Object(b["n"])(e)?o.source.dispose():a.push(o));Object(b["v"])(e);for(const{name:c,source:s}of a)(Object(o["j"])(r)||/\.(gltf|glb)/i.test(c))&&(r=s.url),n.set(c,s.url),s.files&&s.files.forEach((t,e)=>n.set(e,t));if(Object(o["j"])(r))throw new c["a"]("mesh-load-external:missing-files","Missing files to load external mesh source");return new $(r,()=>a.forEach(({source:t})=>t.dispose()),n)}async function B(t,e){const{default:r}=await Object(b["z"])(Promise.resolve().then(n.bind(null,"2eab")),e),o="string"==typeof t.multipart[0]?await Promise.all(t.multipart.map(async t=>(await r(t,{responseType:"array-buffer"})).data)):t.multipart;return $.fromBlob(new Blob(o))}class ${constructor(t,e=(()=>{}),n=new Map){this.url=t,this.dispose=e,this.files=n}static fromBlob(t){const e=URL.createObjectURL(t);return new $(e,()=>URL.revokeObjectURL(e))}}var Z=n("1c92"),_=n("dae5"),Y=n("afe1"),q=n("e431"),J=n("f694"),W=n("4554");const X=u["a"].getLogger("esri.geometry.support.meshUtils.offset");function V(t,e,n){t.vertexAttributes&&t.vertexAttributes.position&&(Object(o["k"])(t.transform)?(null!=(null==n?void 0:n.geographic)&&n.geographic!==t.transform.geographic&&X.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${t.transform.geographic}) is not supported`),H(t.transform,e)):Object(F["a"])(t.spatialReference,n)?K(t,e):Q(t,e))}function H(t,e){const n=t.origin;t.origin=Object(q["h"])(Object(O["f"])(),n,e)}function K(t,e){const n=t.spatialReference,r=t.vertexAttributes.position,i=t.vertexAttributes.normal,a=t.vertexAttributes.tangent,c=new Float64Array(r.length),s=Object(o["k"])(i)?new Float32Array(i.length):null,l=Object(o["k"])(a)?new Float32Array(a.length):null,u=t.extent.center,f=et;Object(R["d"])(n,[u.x,u.y,u.z],nt,Object(J["g"])(n)),Object(Z["f"])(rt,nt),Object(q["z"])(f,e,rt),Object(W["f"])(r,n,c),Object(o["k"])(i)&&Object(W["c"])(i,r,c,n,s),Object(o["k"])(a)&&Object(W["e"])(a,r,c,n,l),tt(c,f),Object(W["a"])(c,r,n),Object(o["k"])(i)&&Object(W["b"])(s,r,c,n,i),Object(o["k"])(a)&&Object(W["d"])(l,r,c,n,a),t.vertexAttributesChanged()}function Q(t,e){tt(t.vertexAttributes.position,e),t.vertexAttributesChanged()}function tt(t,e){if(t)for(let n=0;n<t.length;n+=3)for(let r=0;r<3;r++)t[n+r]+=e[r]}const et=Object(O["f"])(),nt=Object(Y["d"])(),rt=Object(_["b"])();function ot(){const{faceDescriptions:t,faceVertexOffsets:e,uvScales:n}=jt,r=4*t.length,o=new Float64Array(3*r),i=new Float32Array(3*r),a=new Float32Array(2*r),c=new Uint32Array(2*t.length*3);let s=0,l=0,u=0,f=0;for(let b=0;b<t.length;b++){const r=t[b],p=s/3;for(const t of e)c[f++]=p+t;const h=r.corners;for(let t=0;t<4;t++){const e=h[t];let c=0;a[u++]=.25*n[t][0]+r.uvOrigin[0],a[u++]=r.uvOrigin[1]-.25*n[t][1];for(let t=0;t<3;t++)0!==r.axis[t]?(o[s++]=.5*r.axis[t],i[l++]=r.axis[t]):(o[s++]=.5*e[c++],i[l++]=0)}}return{position:o,normal:i,uv:a,faces:c}}function it(t,e){const n=t.components[0],r=n.faces,i=dt[e],a=6*i,c=new Uint32Array(6),s=new Uint32Array(r.length-6);let l=0,u=0;for(let o=0;o<r.length;o++)o>=a&&o<a+6?c[l++]=r[o]:s[u++]=r[o];if(Object(o["k"])(t.vertexAttributes.uv)){const e=new Float32Array(t.vertexAttributes.uv),n=4*i*2,r=[0,1,1,1,1,0,0,0];for(let t=0;t<r.length;t++)e[n+t]=r[t];t.vertexAttributes.uv=e}return t.components=[new x["a"]({faces:c,material:n.material}),new x["a"]({faces:s})],t}function at(t=0){const e=Math.round(8*2**t),n=2*e,r=(e-1)*(n+1)+2*n,o=new Float64Array(3*r),i=new Float32Array(3*r),a=new Float32Array(2*r),c=new Uint32Array((e-1)*n*2*3);let s=0,l=0,u=0,f=0;for(let b=0;b<=e;b++){const t=b/e*Math.PI+.5*Math.PI,r=Math.cos(t),p=Math.sin(t);mt[2]=p;const h=0===b||b===e,g=h?n-1:n;for(let O=0;O<=g;O++){const t=O/g*2*Math.PI;mt[0]=-Math.sin(t)*r,mt[1]=Math.cos(t)*r;for(let e=0;e<3;e++)o[s]=.5*mt[e],i[s]=mt[e],++s;a[l++]=(O+(h?.5:0))/n,a[l++]=b/e,0!==b&&O!==n&&(b!==e&&(c[u++]=f,c[u++]=f+1,c[u++]=f-n),1!==b&&(c[u++]=f,c[u++]=f-n,c[u++]=f-n-1)),f++}}return{position:o,normal:i,uv:a,faces:c}}function ct(t=0){const e=5,n=Math.round(16*2**t),r=(e-1)*(n+1)+2*n,o=new Float64Array(3*r),i=new Float32Array(3*r),a=new Float32Array(2*r),c=new Uint32Array(4*n*3);let s=0,l=0,u=0,f=0,b=0;for(let p=0;p<=e;p++){const t=0===p||p===e,r=p<=1||p>=e-1,h=2===p||4===p,g=t?n-1:n;for(let O=0;O<=g;O++){const j=O/g*2*Math.PI,d=t?0:.5;mt[0]=d*Math.sin(j),mt[1]=d*-Math.cos(j),mt[2]=p<=2?.5:-.5;for(let t=0;t<3;t++)o[s++]=mt[t],i[l++]=r?2===t?p<=1?1:-1:0:2===t?0:mt[t]/d;a[u++]=(O+(t?.5:0))/n,a[u++]=p<=1?1*p/3:p<=3?1*(p-2)/3+1/3:1*(p-4)/3+2/3,h||0===p||O===n||(p!==e&&(c[f++]=b,c[f++]=b+1,c[f++]=b-n),1!==p&&(c[f++]=b,c[f++]=b-n,c[f++]=b-n-1)),b++}}return{position:o,normal:i,uv:a,faces:c}}function st(t,e){const n="number"==typeof e?e:null!=e?e.width:1,r="number"==typeof e?e:null!=e?e.height:1;switch(t){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 lt(t){const e=pt.facingAxisOrderSwap[t],n=pt.position,r=pt.normal,o=new Float64Array(n.length),i=new Float32Array(r.length);let a=0;for(let c=0;c<4;c++){const t=a;for(let c=0;c<3;c++){const s=e[c],l=Math.abs(s)-1,u=s>=0?1:-1;o[a]=n[t+l]*u,i[a]=r[t+l]*u,a++}}return{position:o,normal:i,uv:new Float32Array(pt.uv),faces:new Uint32Array(pt.faces)}}const ut=1,ft=2,bt=3,pt={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:[bt,ut,ft],west:[-bt,-ut,ft],north:[-ut,bt,ft],south:[ut,-bt,ft],up:[ut,ft,bt],down:[ut,-ft,-bt]}};function ht(t,e,n){gt(t),Ot(t,n&&n.size);const{vertexAttributes:r,transform:o}=Object(M["c"])(t,e,n);return{vertexAttributes:new w["a"]({...r,uv:t.uv}),transform:o,components:[new x["a"]({faces:t.faces,material:n&&n.material||null})],spatialReference:e.spatialReference}}function gt(t){for(let e=0;e<t.position.length;e+=3)t.position[e+2]+=.5}function Ot(t,e){if(null==e)return;const n="number"==typeof e?[e,e,e]:[null!=e.width?e.width:1,null!=e.depth?e.depth:1,null!=e.height?e.height:1];yt[0]=n[0],yt[4]=n[1],yt[8]=n[2];for(let r=0;r<t.position.length;r+=3){for(let e=0;e<3;e++)mt[e]=t.position[r+e];Object(q["z"])(mt,mt,yt);for(let e=0;e<3;e++)t.position[r+e]=mt[e]}if(n[0]!==n[1]||n[1]!==n[2]){yt[0]=1/n[0],yt[4]=1/n[1],yt[8]=1/n[2];for(let e=0;e<t.normal.length;e+=3){for(let n=0;n<3;n++)mt[n]=t.normal[e+n];Object(q["z"])(mt,mt,yt),Object(q["t"])(mt,mt);for(let n=0;n<3;n++)t.normal[e+n]=mt[n]}}}const jt={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},dt={south:0,east:1,north:2,west:3,up:4,down:5},mt=Object(O["f"])(),yt=Object(_["b"])();var xt=n("d791");const vt=u["a"].getLogger("esri.geometry.support.meshUtils.rotate");function wt(t,e,n){if(!t.vertexAttributes||!t.vertexAttributes.position||0===e[3])return;const r=t.spatialReference;if(Object(o["k"])(t.transform)){var i;null!=(null==n?void 0:n.geographic)&&n.geographic!==t.transform.geographic&&vt.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${t.transform.geographic}) is not supported`);const o=null!=(i=null==n?void 0:n.origin)?i:t.transform.getOriginPoint(r);At(t.transform,e,o)}else{var a;const r=null!=(a=null==n?void 0:n.origin)?a:t.origin;Object(F["a"])(t.spatialReference,n)?Rt(t,e,r):Ft(t,e,r)}}function At(t,e,n){const r=Object(q["y"])(kt,n.x,n.y,n.z),o=Object(q["l"])(kt,r,t.origin);t.applyLocalInverse(o,Et),t.rotation=Object(y["c"])(t.rotation,e,Object(y["d"])()),t.applyLocalInverse(o,o),Object(q["l"])(o,o,Et),t.translation=Object(q["h"])(Object(O["f"])(),t.translation,o)}function Rt(t,e,n){const r=t.spatialReference,i=Object(J["g"])(r),a=Tt;Object(R["t"])(n,a,i)||Object(R["t"])(t.origin,a,i);const c=t.vertexAttributes.position,s=t.vertexAttributes.normal,l=t.vertexAttributes.tangent,u=new Float64Array(c.length),f=Object(o["k"])(s)?new Float32Array(s.length):null,b=Object(o["k"])(l)?new Float32Array(l.length):null;Object(R["d"])(i,a,Pt,i),Object(Z["f"])(Lt,Pt);const p=zt;Object(q["z"])(Object(y["b"])(zt),Object(y["b"])(e),Lt),p[3]=e[3],Object(W["f"])(c,r,u),Object(o["k"])(s)&&Object(W["c"])(s,c,u,r,f),Object(o["k"])(l)&&Object(W["e"])(l,c,u,r,b),Mt(u,p,3,a),Object(W["a"])(u,c,r),Object(o["k"])(s)&&(Mt(f,p,3),Object(W["b"])(f,c,u,r,s)),Object(o["k"])(l)&&(Mt(b,p,4),Object(W["d"])(b,c,u,r,l)),t.vertexAttributesChanged()}function Ft(t,e,n){const r=Tt;if(!Object(R["t"])(n,r,t.spatialReference)){const e=t.origin;r[0]=e.x,r[1]=e.y,r[2]=e.z,vt.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${t.spatialReference.wkid}).`)}Mt(t.vertexAttributes.position,e,3,r),Mt(t.vertexAttributes.normal,e,3),Mt(t.vertexAttributes.tangent,e,4),t.vertexAttributesChanged()}function Mt(t,e,n,r=O["c"]){if(!Object(o["j"])(t)){Object(xt["e"])(Pt,Object(y["a"])(e),Object(y["b"])(e));for(let e=0;e<t.length;e+=n){for(let n=0;n<3;n++)kt[n]=t[e+n]-r[n];Object(q["s"])(kt,kt,Pt);for(let n=0;n<3;n++)t[e+n]=kt[n]+r[n]}}}const kt=Object(O["f"])(),Et=Object(O["f"])(),zt=Object(y["d"])(),Pt=Object(Y["d"])(),Lt=Object(_["b"])(),Tt=Object(O["f"])(),It=u["a"].getLogger("esri.geometry.support.meshUtils.scale");function Nt(t,e,n){if(!t.vertexAttributes||!t.vertexAttributes.position)return;const r=t.spatialReference;if(Object(o["k"])(t.transform)){var i;null!=(null==n?void 0:n.geographic)&&n.geographic!==t.transform.geographic&&It.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${t.transform.geographic}) is not supported`);const o=null!=(i=null==n?void 0:n.origin)?i:t.transform.getOriginPoint(r);St(t.transform,e,o)}else{const r=Object(F["a"])(t.spatialReference,n),o=n&&n.origin||t.origin;r?Ct(t,e,o):Dt(t,e,o)}}function St(t,e,n){const r=Object(q["y"])(Gt,n.x,n.y,n.z),o=Object(q["l"])(Gt,r,t.origin);t.applyLocalInverse(o,Bt);const i=Object(q["g"])(Object(O["f"])(),t.scale,e);t.scale=i,t.applyLocalInverse(o,o),Object(q["l"])(o,o,Bt),t.translation=Object(q["h"])(Object(O["f"])(),t.translation,o)}function Ct(t,e,n){const r=t.spatialReference,i=Object(J["g"])(r),a=$t;Object(R["t"])(n,a,i)||Object(R["t"])(t.origin,a,i);const c=t.vertexAttributes.position,s=t.vertexAttributes.normal,l=t.vertexAttributes.tangent,u=new Float64Array(c.length),f=Object(o["k"])(s)?new Float32Array(s.length):null,b=Object(o["k"])(l)?new Float32Array(l.length):null;Object(W["f"])(c,r,u),Object(o["k"])(s)&&Object(W["c"])(s,c,u,r,f),Object(o["k"])(l)&&Object(W["e"])(l,c,u,r,b),Ut(u,e,a),Object(W["a"])(u,c,r),Object(o["k"])(s)&&Object(W["b"])(f,c,u,r,s),Object(o["k"])(l)&&Object(W["d"])(b,c,u,r,l),t.vertexAttributesChanged()}function Dt(t,e,n){const r=$t;if(!Object(R["t"])(n,r,t.spatialReference)){const e=t.origin;r[0]=e.x,r[1]=e.y,r[2]=e.z,It.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${t.spatialReference.wkid}).`)}Ut(t.vertexAttributes.position,e,r),t.vertexAttributesChanged()}function Ut(t,e,n=O["c"]){if(t)for(let r=0;r<t.length;r+=3){for(let e=0;e<3;e++)Gt[e]=t[r+e]-n[e];Object(q["g"])(Gt,Gt,e);for(let e=0;e<3;e++)t[r+e]=Gt[e]+n[e]}}const Gt=Object(O["f"])(),Bt=Object(O["f"])(),$t=Object(O["f"])();var Zt;const _t=u["a"].getLogger("esri.geometry.Mesh");let Yt=Zt=class extends(Object(s["b"])(l["a"].LoadableMixin(Object(f["b"])(j["a"])))){constructor(t){super(t),this.components=null,this.transform=null,this.external=null,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new w["a"],this.type="mesh"}initialize(){(Object(o["j"])(this.external)||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.handles.add(Object(p["e"])(()=>{var t;return{vertexAttributes:this.vertexAttributes,components:null==(t=this.components)?void 0:t.map(t=>t.clone()),transform:Object(o["k"])(this.transform)?this.transform.clone():null}},()=>this._set("external",null),{once:!0,sync:!0}))})}get hasExtent(){return!this.loaded&&Object(o["k"])(this.external)&&Object(o["k"])(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get boundingInfo(){const t=this.vertexAttributes.position,e=this.spatialReference;if(0===t.length||this.components&&0===this.components.length)return{extent:new i["a"]({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:e}),center:new d["a"]({x:0,y:0,z:0,spatialReference:e})};const n=Object(o["k"])(this.transform)?this.transform.project(t,e):t;let r=1/0,a=1/0,c=1/0,s=-1/0,l=-1/0,u=-1/0,f=0,b=0,p=0;const h=n.length,g=1/(h/3);let O=0;for(;O<h;){const t=n[O++],e=n[O++],o=n[O++];r=Math.min(r,t),a=Math.min(a,e),c=Math.min(c,o),s=Math.max(s,t),l=Math.max(l,e),u=Math.max(u,o),f+=g*t,b+=g*e,p+=g*o}return{extent:new i["a"]({xmin:r,ymin:a,zmin:c,xmax:s,ymax:l,zmax:u,spatialReference:e}),center:new d["a"]({x:f,y:b,z:p,spatialReference:e})}}get anchor(){if(Object(o["k"])(this.transform))return this.transform.getOriginPoint(this.spatialReference);const t=this.boundingInfo;return new d["a"]({x:t.center.x,y:t.center.y,z:t.extent.zmin,spatialReference:this.spatialReference})}get origin(){return Object(o["k"])(this.transform)?this.transform.getOriginPoint(this.spatialReference):this.boundingInfo.center}get extent(){return!this.loaded&&Object(o["k"])(this.external)&&Object(o["k"])(this.external.extent)?this.external.extent.clone():this.boundingInfo.extent}addComponent(t){this.loaded?(this.components||(this.components=[]),this.components.push(x["a"].from(t)),this.notifyChange("components")):_t.error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(t){if(this.loaded){if(this.components){const e=this.components.indexOf(t);if(-1!==e)return this.components.splice(e,1),void this.notifyChange("components")}_t.error("removeComponent()","Provided component is not part of the list of components")}else _t.error("removeComponent()","Mesh must be loaded before applying operations")}rotate(t,e,n,r){return Object(y["e"])(qt.x,t,Jt),Object(y["e"])(qt.y,e,Wt),Object(y["e"])(qt.z,n,Xt),Object(y["c"])(Jt,Wt,Jt),Object(y["c"])(Jt,Xt,Jt),wt(this,Jt,r),this}offset(t,e,n,r){return this.loaded?(Vt[0]=t,Vt[1]=e,Vt[2]=n,V(this,Vt,r),this):(_t.error("offset()","Mesh must be loaded before applying operations"),this)}scale(t,e){return this.loaded?(Nt(this,t,e),this):(_t.error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(t,e){return this.loaded?(E(this,t,e),this):(_t.error("centerAt()","Mesh must be loaded before applying operations"),this)}load(t){return Object(o["k"])(this.external)&&this.addResolvingPromise(C(this,this.external.source,t)),Promise.resolve(this)}clone(){const t=this.components?new Map:null,e=this.components?new Map:null,n={components:this.components?this.components.map(n=>n.cloneWithDeduplication(t,e)):null,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),transform:Object(o["k"])(this.transform)?this.transform.clone():null,external:Object(o["k"])(this.external)?{source:this.external.source,extent:Object(o["k"])(this.external.extent)?this.external.extent.clone():null}:null};return new Zt(n)}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(t){const{toBinaryGLTF:e}=await n.e("chunk-2d23775c").then(n.bind(null,"fae0"));return e(this,t)}static createBox(t,e){if(!(t instanceof d["a"]))return _t.error(".createBox()","expected location to be a Point instance"),null;const n=new Zt(ht(ot(),t,e));return e&&e.imageFace&&"all"!==e.imageFace?it(n,e.imageFace):n}static createSphere(t,e){return t instanceof d["a"]?new Zt(ht(at(e&&e.densificationFactor||0),t,e)):(_t.error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(t,e){return t instanceof d["a"]?new Zt(ht(ct(e&&e.densificationFactor||0),t,e)):(_t.error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(t,e){var n;if(!(t instanceof d["a"]))return _t.error(".createPlane()","expected location to be a Point instance"),null;const r=null!=(n=null==e?void 0:e.facing)?n:"up",o=st(r,null==e?void 0:e.size);return new Zt(ht(lt(r),t,{...e,size:o}))}static createFromPolygon(t,e){if(!(t instanceof m["a"]))return _t.error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const n=Object(A["c"])(t);return new Zt({vertexAttributes:new w["a"]({position:n.position}),components:[new x["a"]({faces:n.faces,shading:"flat",material:e&&e.material||null})],spatialReference:t.spatialReference})}static async createFromGLTF(t,e,r){if(!(t instanceof d["a"]))throw _t.error(".createfromGLTF()","expected location to be a Point instance"),new c["a"]("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:o}=await Object(b["z"])(n.e("chunk-2d2290bf").then(n.bind(null,"dc7a")),r);return new Zt(await o(t,e,r))}static createWithExternalSource(t,e,n){var r,o,i;const a=null!=(r=null==n?void 0:n.extent)?r:null,c=null!=(o=null==n?void 0:n.transform.clone())?o:new v["a"];c.origin=[t.x,t.y,null!=(i=t.z)?i:0];const s=t.spatialReference;return new Zt({external:{source:e,extent:a},transform:c,spatialReference:s})}static createIncomplete(t,e){var n,r;const o=null!=(n=null==e?void 0:e.transform.clone())?n:new v["a"];o.origin=[t.x,t.y,null!=(r=t.z)?r:0];const i=t.spatialReference,a=new Zt({transform:o,spatialReference:i});return a.addResolvingPromise(Promise.reject(new c["a"]("mesh-incomplete","Mesh resources are not complete"))),a}};Object(a["a"])([Object(h["b"])({type:[x["a"]],json:{write:!0}})],Yt.prototype,"components",void 0),Object(a["a"])([Object(h["b"])({type:v["a"],json:{write:!0}})],Yt.prototype,"transform",void 0),Object(a["a"])([Object(h["b"])({constructOnly:!0})],Yt.prototype,"external",void 0),Object(a["a"])([Object(h["b"])({readOnly:!0})],Yt.prototype,"hasExtent",null),Object(a["a"])([Object(h["b"])({readOnly:!0})],Yt.prototype,"boundingInfo",null),Object(a["a"])([Object(h["b"])({readOnly:!0})],Yt.prototype,"anchor",null),Object(a["a"])([Object(h["b"])({readOnly:!0})],Yt.prototype,"origin",null),Object(a["a"])([Object(h["b"])({readOnly:!0,json:{read:!1}})],Yt.prototype,"extent",null),Object(a["a"])([Object(h["b"])({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Yt.prototype,"hasZ",void 0),Object(a["a"])([Object(h["b"])({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Yt.prototype,"hasM",void 0),Object(a["a"])([Object(h["b"])({type:w["a"],nonNullable:!0,json:{write:!0}})],Yt.prototype,"vertexAttributes",void 0),Yt=Zt=Object(a["a"])([Object(g["a"])("esri.geometry.Mesh")],Yt);const qt={x:Object(O["h"])(1,0,0),y:Object(O["h"])(0,1,0),z:Object(O["h"])(0,0,1)},Jt=Object(y["d"])(),Wt=Object(y["d"])(),Xt=Object(y["d"])(),Vt=Object(O["f"])(),Ht=Yt;var Kt,Qt;!function(t){t.featureGUID="featureGUID",t.assetName="assetName",t.hash="hash",t.type="type",t.conversionStatus="conversionStatus",t.flags="flags",t.complexity="complexity",t.size="size",t.seqNo="seqNo",t.sourceHash="sourceHash",t.assetURL="assetURL"}(Kt||(Kt={})),function(t){t.SUBMITTED="SUBMITTED",t.INPROGRESS="INPROGRESS",t.FAILED="FAILED",t.COMPLETED="COMPLETED"}(Qt||(Qt={}));var te,ee=n("2edc");function ne(t,e,n){const i=n.features;n.features=[],delete n.geometryType;const a=ee["default"].fromJSON(n);a.geometryType="mesh";const c=a.spatialReference,s=Object(o["j"])(t.outFields)||!t.outFields.length?()=>({}):re(t.outFields.includes("*")?null:new Set(t.outFields));for(const l of i){const t=oe(l,c,e);Object(o["k"])(t)&&a.features.push(new r["a"]({geometry:t,attributes:s(l)}))}return a}function re(t){return({attributes:e})=>{if(!e)return{};if(!t)return e;for(const n in e)t.has(n)||delete e[n];return e}}function oe(t,e,n){const{status:r,source:o}=ce(t);if(r===te.FAILED)return null;const a=ie(t,e,n),c=i["a"].fromJSON(t.geometry);c.spatialReference=e;const s=ae(t,n);return r===te.PENDING?Ht.createIncomplete(a,{extent:c,transform:s}):Ht.createWithExternalSource(a,o,{extent:c,transform:s})}function ie({attributes:t},e,{transformFieldRoles:n}){return new d["a"]({x:t[n.originX],y:t[n.originY],z:t[n.originZ],spatialReference:e})}function ae({attributes:t,assetMappings:e},{transformFieldRoles:n}){var r;return new v["a"]({translation:[t[n.translationX],t[n.translationY],t[n.translationZ]],rotation:Object(y["e"])([t[n.rotationX],t[n.rotationY],t[n.rotationZ]],t[n.rotationDeg]),scale:[t[n.scaleX],t[n.scaleY],t[n.scaleZ]],geographic:!(null!=(r=e[Kt.flags])&&r.includes("PROJECT_VERTICES"))})}function ce(t){if(!t.assetMappings)return{status:te.FAILED};const e=[],n=new Map;for(const r of t.assetMappings){const t=r[Kt.seqNo],o=r[Kt.assetName],i=r[Kt.assetURL],a=r[Kt.conversionStatus];if(a===Qt.FAILED)return{status:te.FAILED};if(a!==Qt.COMPLETED)return{status:te.PENDING};if(null==t)e.push({name:o,source:i});else{const r=n.get(o);let a;r?a=r.multipart:(a=[],e.push({name:o,source:{multipart:a}}),n.set(o,{multipart:a})),a[t]=i}}return{status:te.COMPLETED,source:e}}!function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(te||(te={}))},"33b0":function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return c})),n.d(e,"e",(function(){return s}));var r=n("38a4"),o=n("04f0"),i=n("b139"),a=n("e431");function c(t=p){return[t[0],t[1],t[2],t[3]]}function s(t,e,n=c()){return Object(a["m"])(u(n),t),n[3]=e,n}function l(t,e,n=c()){return Object(o["h"])(h,u(t),f(t)),Object(o["h"])(g,u(e),f(e)),Object(o["f"])(h,g,h),b(n,Object(r["p"])(Object(o["c"])(u(n),h)))}function u(t){return t}function f(t){return Object(r["h"])(t[3])}function b(t,e){return t[3]=e,t}const p=[0,0,1,0],h=Object(i["b"])(),g=Object(i["b"])();c()},"3ebc":function(t,e,n){"use strict";function r(t,e){var n;return t.isGeographic||t.isWebMercator&&(null==(n=null==e?void 0:e.geographic)||n)}n.d(e,"a",(function(){return r}))},"64d5":function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var r,o=n("a4ee"),i=n("6a0ed"),a=n("b2b2"),c=n("59b2"),s=(n("b50f"),n("c120"),n("cea0"),n("d386")),l=n("d791"),u=n("afe1"),f=n("e431"),b=n("0b2d"),p=n("4ae5"),h=n("8188"),g=n("f694"),O=n("33b0"),j=n("8190"),d=n("668b"),m=n("4c96");let y=r=class extends i["a"]{constructor(t){super(t),this.origin=Object(b["f"])(),this.translation=Object(b["f"])(),this.rotation=Object(O["d"])(),this.scale=Object(b["h"])(1,1,1),this.geographic=!0}get localMatrix(){const t=Object(u["d"])();return Object(l["v"])(t,this.scale),Object(l["f"])(t,t,Object(O["a"])(this.rotation),Object(O["b"])(this.rotation)),Object(l["k"])(t,t,this.translation),t}get localMatrixInverse(){return Object(l["b"])(Object(u["d"])(),this.localMatrix)}applyLocal(t,e){return Object(f["s"])(e,t,this.localMatrix)}applyLocalInverse(t,e){return Object(f["s"])(e,t,this.localMatrixInverse)}project(t,e){const n=new Float64Array(t.length),r=j["v"].fromTypedArray(n),o=j["v"].fromTypedArray(t);if(this.geographic){const t=Object(g["g"])(e),i=Object(u["d"])();return Object(h["d"])(e,this.origin,i,t),Object(l["n"])(i,i,this.localMatrix),Object(d["e"])(r,o,i),Object(h["p"])(n,t,0,n,e,0,n.length/3),n}const{localMatrix:i,origin:a}=this;Object(l["w"])(i,u["a"])?Object(m["a"])(r,o):Object(d["e"])(r,o,i);for(let c=0;c<n.length;c+=3)n[c+0]+=a[0],n[c+1]+=a[1],n[c+2]+=a[2];return n}getOriginPoint(t){const[e,n,r]=this.origin;return new p["a"]({x:e,y:n,z:r,spatialReference:t})}equals(t){return Object(a["k"])(t)&&this.geographic===t.geographic&&Object(f["q"])(this.origin,t.origin)&&Object(l["x"])(this.localMatrix,t.localMatrix)}clone(){const t={origin:Object(b["d"])(this.origin),translation:Object(b["d"])(this.translation),rotation:Object(O["d"])(this.rotation),scale:Object(b["d"])(this.scale),geographic:this.geographic};return new r(t)}};Object(o["a"])([Object(c["b"])({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"origin",void 0),Object(o["a"])([Object(c["b"])({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"translation",void 0),Object(o["a"])([Object(c["b"])({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"rotation",void 0),Object(o["a"])([Object(c["b"])({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"scale",void 0),Object(o["a"])([Object(c["b"])({type:Boolean,nonNullable:!0,json:{write:!0}})],y.prototype,"geographic",void 0),Object(o["a"])([Object(c["b"])()],y.prototype,"localMatrix",null),Object(o["a"])([Object(c["b"])()],y.prototype,"localMatrixInverse",null),y=r=Object(o["a"])([Object(s["a"])("esri.geometry.support.MeshTransform")],y);const x=y},e9ba:function(t,e,n){"use strict";n.d(e,"a",(function(){return O})),n.d(e,"b",(function(){return j})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return m})),n.d(e,"e",(function(){return y}));var r=n("b2b2"),o=n("8048"),i=n("dae5"),a=n("d791"),c=n("afe1"),s=n("1c92"),l=n("8188"),u=n("f694"),f=n("64d5"),b=n("8190"),p=n("668b"),h=n("3ebc"),g=n("4554");function O(t,e,n){return Object(h["a"])(e.spatialReference,n)?v(t,e,n):x(t,e,n)}function j(t,e,n){const{position:o,normal:i,tangent:a}=t;if(Object(r["j"])(e))return{position:o,normal:i,tangent:a};const c=e.localMatrix;return O({position:Object(g["h"])(o,new Float64Array(o.length),c),normal:Object(r["k"])(i)?Object(g["g"])(i,new Float32Array(i.length),c):null,tangent:Object(r["k"])(a)?Object(g["i"])(a,new Float32Array(a.length),c):null},e.getOriginPoint(n),{geographic:e.geographic})}function d(t,e,n){if(null!=n&&n.useTransform){var r;const{position:o,normal:i,tangent:a}=t;return{vertexAttributes:{position:o,normal:i,tangent:a},transform:new f["a"]({origin:[e.x,e.y,null!=(r=e.z)?r:0],geographic:Object(h["a"])(e.spatialReference,n)})}}return{vertexAttributes:O(t,e,n),transform:null}}function m(t,e,n){return Object(h["a"])(e.spatialReference,n)?M(t,e,n):F(t,e,n)}function y(t,e,n,o){if(Object(r["j"])(e))return m(t,n,o);const i=j(t,e,n.spatialReference);return n.equals(e.getOriginPoint(n.spatialReference))?F(i,n,o):Object(h["a"])(n.spatialReference,o)?M(i,n,o):F(i,n,o)}function x(t,e,n){const r=new Float64Array(t.position.length),o=t.position,i=e.x,a=e.y,c=e.z||0,{horizontal:s,vertical:l}=L(n?n.unit:null,e.spatialReference);for(let u=0;u<o.length;u+=3)r[u+0]=o[u+0]*s+i,r[u+1]=o[u+1]*s+a,r[u+2]=o[u+2]*l+c;return{position:r,normal:t.normal,tangent:t.tangent}}function v(t,e,n){const r=e.spatialReference,o=k(e,n,T),i=new Float64Array(t.position.length),a=w(t.position,o,r,i),c=Object(s["a"])(N,o);return{position:a,normal:A(a,i,t.normal,c,r),tangent:R(a,i,t.tangent,c,r)}}function w(t,e,n,r){Object(p["e"])(b["v"].fromTypedArray(r),b["v"].fromTypedArray(t),e);const o=new Float64Array(t.length);return Object(g["a"])(r,o,n)}function A(t,e,n,o,i){if(Object(r["j"])(n))return null;const a=new Float32Array(n.length);return Object(p["a"])(b["u"].fromTypedArray(a),b["u"].fromTypedArray(n),o),Object(g["b"])(a,t,e,i,a),a}function R(t,e,n,o,i){if(Object(r["j"])(n))return null;const a=new Float32Array(n.length);Object(p["a"])(b["u"].fromTypedArray(a,4*Float32Array.BYTES_PER_ELEMENT),b["u"].fromTypedArray(n,4*Float32Array.BYTES_PER_ELEMENT),o);for(let r=3;r<a.length;r+=4)a[r]=n[r];return Object(g["d"])(a,t,e,i,a),a}function F(t,e,n){const r=new Float64Array(t.position.length),o=t.position,i=e.x,a=e.y,c=e.z||0,{horizontal:s,vertical:l}=L(n?n.unit:null,e.spatialReference);for(let u=0;u<o.length;u+=3)r[u+0]=(o[u+0]-i)/s,r[u+1]=(o[u+1]-a)/s,r[u+2]=(o[u+2]-c)/l;return{position:r,normal:t.normal,tangent:t.tangent}}function M(t,e,n){const r=e.spatialReference;k(e,n,T);const o=Object(a["b"])(I,T),i=new Float64Array(t.position.length),c=E(t.position,r,o,i),l=Object(s["a"])(N,o);return{position:c,normal:z(t.normal,t.position,i,r,l),tangent:P(t.tangent,t.position,i,r,l)}}function k(t,e,n){Object(l["d"])(t.spatialReference,[t.x,t.y,t.z||0],n,Object(u["g"])(t.spatialReference));const{horizontal:r,vertical:o}=L(e?e.unit:null,t.spatialReference);return Object(a["i"])(n,n,[r,r,o]),n}function E(t,e,n,r){const o=Object(g["f"])(t,e,r),i=b["v"].fromTypedArray(o),a=new Float64Array(o.length),c=b["v"].fromTypedArray(a);return Object(p["e"])(c,i,n),a}function z(t,e,n,o,i){if(Object(r["j"])(t))return null;const a=Object(g["c"])(t,e,n,o,new Float32Array(t.length)),c=b["u"].fromTypedArray(a);return Object(p["a"])(c,c,i),a}function P(t,e,n,o,i){if(Object(r["j"])(t))return null;const a=Object(g["e"])(t,e,n,o,new Float32Array(t.length)),c=b["u"].fromTypedArray(a,4*Float32Array.BYTES_PER_ELEMENT);return Object(p["a"])(c,c,i),a}function L(t,e){if(Object(r["j"])(t))return S;const n=e.isGeographic?1:Object(o["e"])(e),i=e.isGeographic?1:Object(o["g"])(e),a=Object(o["c"])(1,t,"meters");return{horizontal:a*n,vertical:a*i}}const T=Object(c["d"])(),I=Object(c["d"])(),N=Object(i["b"])(),S={horizontal:1,vertical:1}}}]);
- //# sourceMappingURL=chunk-8c86bcce.316b60cc.js.map
|