// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("../chunks/tslib.es6 ../request ../core/Error ../core/Logger ../core/mathUtils ../core/MultiOriginJSONSupport ../core/promiseUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../chunks/vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/ellipsoidUtils ../geometry/Extent ../geometry/SpatialReference ../geometry/projection/projectBuffer ./Layer ./mixins/APIKeyMixin ./mixins/ArcGISService ./mixins/CustomParametersMixin ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/ScaleRangeLayer ./support/commonProperties ../support/elevationInfoUtils".split(" "), function(l,z,A,v,q,h,w,m,J,K,B,d,g,t,n,p,u,C,D,E,F,G,H,I,x,r){h=class extends E.ArcGISService(G.OperationalLayer(H.PortalLayer(I.ScaleRangeLayer(h.MultiOriginJSONMixin(F.CustomParametersMixin(D.APIKeyMixin(C))))))){constructor(c){super(c);this.operationalLayerType="IntegratedMesh3DTilesLayer";this.spatialReference=new p({wkid:4326,vcsWkid:115700});this.fullExtent=new n(-180,-90,180,90,this.spatialReference);this.url=null;this.type="integrated-mesh-3dtiles";this.path=null;this.maxScale=this.minScale= 0}set elevationInfo(c){this._set("elevationInfo",c);this._validateElevationInfo()}_verifyArray(c,b){if(!Array.isArray(c)||c.lengthy;++y)a.push(g.create());d.add(a[0],b,e);d.add(a[0],a[0],k);d.add(a[0],a[0],f);d.sub(a[1],b,e);d.add(a[1],a[1], k);d.add(a[1],a[1],f);d.add(a[2],b,e);d.sub(a[2],a[2],k);d.add(a[2],a[2],f);d.sub(a[3],b,e);d.sub(a[3],a[3],k);d.add(a[3],a[3],f);d.add(a[4],b,e);d.add(a[4],a[4],k);d.sub(a[4],a[4],f);d.sub(a[5],b,e);d.add(a[5],a[5],k);d.sub(a[5],a[5],f);d.add(a[6],b,e);d.sub(a[6],a[6],k);d.sub(a[6],a[6],f);d.sub(a[7],b,e);d.sub(a[7],a[7],k);d.sub(a[7],a[7],f);if(c&&this._verifyArray(c,16))for(b=0;8>b;++b)d.transformMat4(a[b],a[b],c);c=g.fromValues(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);b=g.fromValues(Number.MAX_VALUE, Number.MAX_VALUE,Number.MAX_VALUE);for(e=0;8>e;++e)u.projectBuffer(a[e],t.WGS84ECEFSpatialReferenceLike,0,a[e],p.WGS84,0,1),d.min(b,b,a[e]),d.max(c,c,a[e]);this.fullExtent=new n({xmin:b[0],ymin:b[1],zmin:b[2],xmax:c[0],ymax:c[1],zmax:c[2],spatialReference:this.spatialReference})}}}async load(c){this.addResolvingPromise(this._doLoad(c));return this}async _doLoad(c){const b=null!=c?c.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:a=>{if(a.typeKeywords?.includes("IntegratedMesh"))return!0; throw new A("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"});}},c)}catch(a){w.throwIfAbortError(a)}this.url&&await z(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:b}).then(a=>{this._initFullExtent(a.data)},a=>{w.throwIfAbortError(a)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const c=this.elevationInfo;r.logInvalidElevationInfoWarning(v.getLogger(this), r.elevationModeRequiredMessage("Integrated mesh 3d tiles layers","absolute-height",c));r.logInvalidElevationInfoWarning(v.getLogger(this),r.featureExpressionUnsupportedMessage("Integrated mesh 3d tiles layers",c))}};l.__decorate([m.property({type:["IntegratedMesh3DTilesLayer"]})],h.prototype,"operationalLayerType",void 0);l.__decorate([m.property({type:p})],h.prototype,"spatialReference",void 0);l.__decorate([m.property({type:n})],h.prototype,"fullExtent",void 0);l.__decorate([m.property(x.elevationInfo)], h.prototype,"elevationInfo",null);l.__decorate([m.property({type:["show","hide"]})],h.prototype,"listMode",void 0);l.__decorate([m.property(x.url)],h.prototype,"url",void 0);l.__decorate([m.property({readOnly:!0})],h.prototype,"type",void 0);l.__decorate([m.property({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],h.prototype,"path",void 0);l.__decorate([m.property({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1, write:!1}}}})],h.prototype,"minScale",void 0);l.__decorate([m.property({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],h.prototype,"maxScale",void 0);return h=l.__decorate([B.subclass("esri.layers.IntegratedMesh3DTilesLayer")],h)});