/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.115 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ import{a as L,b as u,c as H,d as jn,e as on}from"./chunk-QHMHXQHC.js";import{a as d}from"./chunk-GGFNGKXD.js";import{a as Rn}from"./chunk-6DW2D3WX.js";import{a as T}from"./chunk-A7LPWAU6.js";import{a as J,b as y}from"./chunk-UNVMUIJM.js";import{e as z}from"./chunk-WVB7XP3Q.js";function h(n,o,c,f){this.x=T(n,0),this.y=T(o,0),this.z=T(c,0),this.w=T(f,0)}h.fromElements=function(n,o,c,f,O){return z(O)?(O.x=n,O.y=o,O.z=c,O.w=f,O):new h(n,o,c,f)};h.fromColor=function(n,o){return y.typeOf.object("color",n),z(o)?(o.x=n.red,o.y=n.green,o.z=n.blue,o.w=n.alpha,o):new h(n.red,n.green,n.blue,n.alpha)};h.clone=function(n,o){if(z(n))return z(o)?(o.x=n.x,o.y=n.y,o.z=n.z,o.w=n.w,o):new h(n.x,n.y,n.z,n.w)};h.packedLength=4;h.pack=function(n,o,c){return y.typeOf.object("value",n),y.defined("array",o),c=T(c,0),o[c++]=n.x,o[c++]=n.y,o[c++]=n.z,o[c]=n.w,o};h.unpack=function(n,o,c){return y.defined("array",n),o=T(o,0),z(c)||(c=new h),c.x=n[o++],c.y=n[o++],c.z=n[o++],c.w=n[o],c};h.packArray=function(n,o){y.defined("array",n);let c=n.length,f=c*4;if(!z(o))o=new Array(f);else{if(!Array.isArray(o)&&o.length!==f)throw new J("If result is a typed array, it must have exactly array.length * 4 elements");o.length!==f&&(o.length=f)}for(let O=0;O=0?R.longitude:R.longitude+d.TWO_PI;O=Math.min(O,E),p=Math.max(p,E)}return f-c>p-O&&(c=O,f=p,f>d.PI&&(f=f-d.TWO_PI),c>d.PI&&(c=c-d.TWO_PI)),z(o)?(o.west=c,o.south=b,o.east=f,o.north=e,o):new q(c,b,f,e)};q.fromCartesianArray=function(n,o,c){y.defined("cartesians",n),o=T(o,jn.WGS84);let f=Number.MAX_VALUE,O=-Number.MAX_VALUE,p=Number.MAX_VALUE,b=-Number.MAX_VALUE,e=Number.MAX_VALUE,j=-Number.MAX_VALUE;for(let t=0,R=n.length;t=0?E.longitude:E.longitude+d.TWO_PI;p=Math.min(p,A),b=Math.max(b,A)}return O-f>b-p&&(f=p,O=b,O>d.PI&&(O=O-d.TWO_PI),f>d.PI&&(f=f-d.TWO_PI)),z(c)?(c.west=f,c.south=e,c.east=O,c.north=j,c):new q(f,e,O,j)};q.clone=function(n,o){if(z(n))return z(o)?(o.west=n.west,o.south=n.south,o.east=n.east,o.north=n.north,o):new q(n.west,n.south,n.east,n.north)};q.equalsEpsilon=function(n,o,c){return c=T(c,0),n===o||z(n)&&z(o)&&Math.abs(n.west-o.west)<=c&&Math.abs(n.south-o.south)<=c&&Math.abs(n.east-o.east)<=c&&Math.abs(n.north-o.north)<=c};q.prototype.clone=function(n){return q.clone(this,n)};q.prototype.equals=function(n){return q.equals(this,n)};q.equals=function(n,o){return n===o||z(n)&&z(o)&&n.west===o.west&&n.south===o.south&&n.east===o.east&&n.north===o.north};q.prototype.equalsEpsilon=function(n,o){return q.equalsEpsilon(this,n,o)};q.validate=function(n){y.typeOf.object("rectangle",n);let o=n.north;y.typeOf.number.greaterThanOrEquals("north",o,-d.PI_OVER_TWO),y.typeOf.number.lessThanOrEquals("north",o,d.PI_OVER_TWO);let c=n.south;y.typeOf.number.greaterThanOrEquals("south",c,-d.PI_OVER_TWO),y.typeOf.number.lessThanOrEquals("south",c,d.PI_OVER_TWO);let f=n.west;y.typeOf.number.greaterThanOrEquals("west",f,-Math.PI),y.typeOf.number.lessThanOrEquals("west",f,Math.PI);let O=n.east;y.typeOf.number.greaterThanOrEquals("east",O,-Math.PI),y.typeOf.number.lessThanOrEquals("east",O,Math.PI)};q.southwest=function(n,o){return y.typeOf.object("rectangle",n),z(o)?(o.longitude=n.west,o.latitude=n.south,o.height=0,o):new u(n.west,n.south)};q.northwest=function(n,o){return y.typeOf.object("rectangle",n),z(o)?(o.longitude=n.west,o.latitude=n.north,o.height=0,o):new u(n.west,n.north)};q.northeast=function(n,o){return y.typeOf.object("rectangle",n),z(o)?(o.longitude=n.east,o.latitude=n.north,o.height=0,o):new u(n.east,n.north)};q.southeast=function(n,o){return y.typeOf.object("rectangle",n),z(o)?(o.longitude=n.east,o.latitude=n.south,o.height=0,o):new u(n.east,n.south)};q.center=function(n,o){y.typeOf.object("rectangle",n);let c=n.east,f=n.west;c0?f+=d.TWO_PI:p0&&(p+=d.TWO_PI),f=R))return z(c)?(c.west=e,c.south=t,c.east=j,c.north=R,c):new q(e,t,j,R)};q.simpleIntersection=function(n,o,c){y.typeOf.object("rectangle",n),y.typeOf.object("otherRectangle",o);let f=Math.max(n.west,o.west),O=Math.max(n.south,o.south),p=Math.min(n.east,o.east),b=Math.min(n.north,o.north);if(!(O>=b||f>=p))return z(c)?(c.west=f,c.south=O,c.east=p,c.north=b,c):new q(f,O,p,b)};q.union=function(n,o,c){y.typeOf.object("rectangle",n),y.typeOf.object("otherRectangle",o),z(c)||(c=new q);let f=n.east,O=n.west,p=o.east,b=o.west;f0?f+=d.TWO_PI:p0&&(p+=d.TWO_PI),fO||d.equalsEpsilon(c,O,d.EPSILON14))&&(c=n.south&&f<=n.north};var In=new u;q.subsample=function(n,o,c,f){y.typeOf.object("rectangle",n),o=T(o,jn.WGS84),c=T(c,0),z(f)||(f=[]);let O=0,p=n.north,b=n.south,e=n.east,j=n.west,t=In;t.height=c,t.longitude=j,t.latitude=p,f[O]=o.cartographicToCartesian(t,f[O]),O++,t.longitude=e,f[O]=o.cartographicToCartesian(t,f[O]),O++,t.latitude=b,f[O]=o.cartographicToCartesian(t,f[O]),O++,t.longitude=j,f[O]=o.cartographicToCartesian(t,f[O]),O++,p<0?t.latitude=p:b>0?t.latitude=b:t.latitude=0;for(let R=1;R<8;++R)t.longitude=-Math.PI+R*d.PI_OVER_TWO,q.contains(n,t)&&(f[O]=o.cartographicToCartesian(t,f[O]),O++);return t.latitude===0&&(t.longitude=j,f[O]=o.cartographicToCartesian(t,f[O]),O++,t.longitude=e,f[O]=o.cartographicToCartesian(t,f[O]),O++),f.length=O,f};q.subsection=function(n,o,c,f,O,p){if(y.typeOf.object("rectangle",n),y.typeOf.number.greaterThanOrEquals("westLerp",o,0),y.typeOf.number.lessThanOrEquals("westLerp",o,1),y.typeOf.number.greaterThanOrEquals("southLerp",c,0),y.typeOf.number.lessThanOrEquals("southLerp",c,1),y.typeOf.number.greaterThanOrEquals("eastLerp",f,0),y.typeOf.number.lessThanOrEquals("eastLerp",f,1),y.typeOf.number.greaterThanOrEquals("northLerp",O,0),y.typeOf.number.lessThanOrEquals("northLerp",O,1),y.typeOf.number.lessThanOrEquals("westLerp",o,f),y.typeOf.number.lessThanOrEquals("southLerp",c,O),z(p)||(p=new q),n.west<=n.east){let e=n.east-n.west;p.west=n.west+o*e,p.east=n.west+f*e}else{let e=d.TWO_PI+n.east-n.west;p.west=d.negativePiToPi(n.west+o*e),p.east=d.negativePiToPi(n.west+f*e)}let b=n.north-n.south;return p.south=n.south+c*b,p.north=n.south+O*b,o===1&&(p.west=n.east),f===1&&(p.east=n.east),c===1&&(p.south=n.north),O===1&&(p.north=n.north),p};q.MAX_VALUE=Object.freeze(new q(-Math.PI,-d.PI_OVER_TWO,Math.PI,d.PI_OVER_TWO));var jo=q;function M(n,o,c,f){this[0]=T(n,0),this[1]=T(c,0),this[2]=T(o,0),this[3]=T(f,0)}M.packedLength=4;M.pack=function(n,o,c){return y.typeOf.object("value",n),y.defined("array",o),c=T(c,0),o[c++]=n[0],o[c++]=n[1],o[c++]=n[2],o[c++]=n[3],o};M.unpack=function(n,o,c){return y.defined("array",n),o=T(o,0),z(c)||(c=new M),c[0]=n[o++],c[1]=n[o++],c[2]=n[o++],c[3]=n[o++],c};M.packArray=function(n,o){y.defined("array",n);let c=n.length,f=c*4;if(!z(o))o=new Array(f);else{if(!Array.isArray(o)&&o.length!==f)throw new J("If result is a typed array, it must have exactly array.length * 4 elements");o.length!==f&&(o.length=f)}for(let O=0;O