/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.122
 *
 * 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 T}from"./chunk-5EHCZUHJ.js";import"./chunk-VEZ5ALJU.js";import{a as f}from"./chunk-PHR4FJWK.js";import"./chunk-6X7WLTTW.js";import{a as G}from"./chunk-JCB2M6SL.js";import{a as C}from"./chunk-6NIX77PU.js";import"./chunk-FG53NUCJ.js";import"./chunk-QTX6TFJQ.js";import"./chunk-5ONJK4IB.js";import"./chunk-6IAPD5DZ.js";import"./chunk-HCBPQXHZ.js";import{a as L}from"./chunk-ZIUWYBT3.js";import"./chunk-45FCQ3FJ.js";import"./chunk-354SKS6C.js";import"./chunk-H5GL2A6Z.js";import{a as w}from"./chunk-UGB43LJM.js";import{a as O}from"./chunk-WFZLZ2P5.js";import{b,c as d,d as k}from"./chunk-N72XKOXM.js";import{d as P}from"./chunk-EWTFJ46X.js";import"./chunk-5IUXF6I3.js";import{a as H}from"./chunk-27UWHT4D.js";import{a as l,d as g}from"./chunk-RFPX772U.js";import"./chunk-RAYRECQS.js";import"./chunk-2NAI7YQ3.js";import"./chunk-QE3ZUOZY.js";import{a as c}from"./chunk-6KLVDWWE.js";import{b as a}from"./chunk-6P5KAIBX.js";import{e as u}from"./chunk-4FSVUTPL.js";function E(e){let r=e.length,t=new Float64Array(3*r),o=w.createTypedArray(r,2*r),n=0,i=0;for(let a=0;a<r;a++){let s=e[a];t[n++]=s.x,t[n++]=s.y,t[n++]=s.z,o[i++]=a,o[i++]=(a+1)%r}let a=new O({position:new k({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:t})});return new d({attributes:a,indices:o,primitiveType:b.LINES})}function m(e){let r=(e=c(e,c.EMPTY_OBJECT)).polygonHierarchy;a.defined("options.polygonHierarchy",r),this._polygonHierarchy=r,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=f.computeHierarchyPackedLength(r,l)+1}m.fromPositions=function(e){return e=c(e,c.EMPTY_OBJECT),a.defined("options.positions",e.positions),new m({polygonHierarchy:{positions:e.positions}})},m.pack=function(e,r,t){return a.typeOf.object("value",e),a.defined("array",r),t=c(t,0),r[t=f.packPolygonHierarchy(e._polygonHierarchy,r,t,l)]=e.packedLength,r};var v={polygonHierarchy:{}};m.unpack=function(e,r,t){a.defined("array",e),r=c(r,0);let o=f.unpackPolygonHierarchy(e,r,l);r=o.startingIndex,delete o.startingIndex;let n=e[r];return u(t)||(t=new m(v)),t._polygonHierarchy=o,t.packedLength=n,t},m.createGeometry=function(e){let r=e._polygonHierarchy,t=r.positions;if(t=L(t,l.equalsEpsilon,!0),t.length<3||!T.validOutline(t))return;let o=f.polygonOutlinesFromHierarchy(r,!1);if(0===o.length)return;let n=[];for(let e=0;e<o.length;e++){let r=new G({geometry:E(o[e])});n.push(r)}let i=C.combineInstances(n)[0],a=P.fromPoints(r.positions);return new d({attributes:i.attributes,indices:i.indices,primitiveType:i.primitiveType,boundingSphere:a})};var h=m;function A(e,r){return u(r)&&(e=h.unpack(e,r)),e._ellipsoid=g.clone(e._ellipsoid),h.createGeometry(e)}var Z=A;export{Z as default};